TK!2
=v
#1
:n
Price
:s
b
:u
$
:d
$
:c
Purchase Price of asset
:a
Price
#2
:n
Downpay
:s
b
:u
$
:d
$
:c
Down Payment
:a
Downpay
#3
:n
dpp
:s
b
:u
1
:d
%
:c
Down Payment Percentage
:a
dpp
#4
:n
Loan
:s
b
:u
$
:d
$
:c
Beginning Balance of Loan
:a
Loan
#5
:n
Term
:s
b
:u
mo
:d
yr
:c
Term of Loan
:a
Term
#6
:n
rate
:v
.008333333333333333
:s
o
:u
1/mo
:d
%/yr
:c
Nominal Interest Rate on Loan
:a
rate
:f
.008333333333333333
#7
:n
Payment
:s
b
:u
$/mo
:d
$/mo
:c
Amount of Periodic Loan Payment
:a
Payment
#8
:n
Tpay
:s
b
:u
$
:d
$
:c
Total of Payments Made over Loan Term
:a
Tpay
#9
:n
Tint
:s
b
:u
$
:d
$
:c
Total Interest Paid over Loan Term
:a
Tint
#10
:n
dummy
:v
0
:s
i
:c
Dummy Variable for Multi-Case Analysis
:a
dummy
#11
:n

:s
b
:c
 (enables list solving over all 
#12
:n

:s
b
:c
 instances with  F10  instead of  /LB)
#14
:n

:s
b
:c
Connection between these variables'
#15
:n

:s
b
:c
associated lists and the lists for
#16
:n

:s
b
:c
data input (similar names ending in
#17
:n

:s
b
:c
"_In") is made in the rule function
#18
:n

:s
b
:c
'assign'.  Each variable's "_In" list
#19
:n

:s
b
:c
has the same Calculation and Display
#20
:n

:s
b
:c
units as its associated list.
=u
#1
:f
yr
:m
12
:t
mo
#2
:f
1
:m
100
:t
%
#3
:f
1/mo
:m
100
:t
%/mo
#4
:f
%/mo
:m
12
:t
%/yr
=l
#1
:n
Price
:d
$
:u
$
:v
12000
12000
15000
15000
15000
15000
15000
9995
72500
11500
E
#2
:n
Downpay
:d
$
:u
$
:v
2000
1800
2000
2000
2250
4559.94964871887
3750
2000
7250
1150
E
#3
:n
dpp
:d
%
:u
1
:v
.1666666666666667
.15
.1333333333333333
.1333333333333333
.15
.3039966432479246
.25
.2001000500250125
.1
.1
E
#4
:n
Loan
:d
$
:u
$
:v
10000
10200
13000
13000
12750
10440.05035128113
11250
7995
65250
10350
E
#5
:n
Term
:d
yr
:u
mo
:v
48
48
68.44168373300596
60
60
48
48
44.54938285641936
360
48
E
#6
:n
rate
:d
%/yr
:u
1/mo
:v
.008333333333333333
.008333333333333333
.008333333333333333
.004816845697148595
.005490798660982884
.005833333333333334
.005833333333333334
.00325
.009083333333333334
.0025
E
#7
:n
Payment
:d
$/mo
:u
$/mo
:v
253.6258343474726
258.698351034422
250
250
250
250
269.3952524524818
193.06
616.4655866166208
229.0902843393787
E
#8
:n
Tpay
:d
$
:u
$
:v
12174.04004867868
12417.52084965226
17110.42093325149
15000
15000
12000
12930.97211771912
8600.70385426032
221927.6111819835
10996.33364829018
E
#9
:n
Tint
:d
$
:u
$
:v
2174.040048678684
2217.520849652257
4110.420933251491
2000
2250
1559.94964871887
1680.972117719124
605.7038542603204
156677.6111819835
646.3336482901777
E
#10
:n
dummy
:v
0
0
0
0
0
0
0
0
0
0
E
#11
:n
Price_In
:d
$
:u
$
:v
12000
12000
15000
15000
15000
15000
15000
9995
72500
11500
E
#12
:n
Downpay_In
:d
$
:u
$
:v
2000






2000
E
#13
:n
dpp_In
:d
%
:u
1
:v

.15


.15

.25

.1
.1
E
#14
:n
Loan_In
:d
$
:u
$
:v


13000
13000
E
#15
:n
Term_In
:d
yr
:u
mo
:v
48
48

60
60
48
48

360
48
E
#16
:n
rate_In
:d
%/yr
:u
1/mo
:v
.008333333333333333
.008333333333333333
.008333333333333333


.005833333333333334
.005833333333333334
.00325
.009083333333333334
.0025
E
#17
:n
Payment_In
:d
$/mo
:u
$/mo
:v


250
250
250
250

193.06
E
#18
:n
MCA_Table
:v
'Price
'Downpay
'dpp
'Loan
'Term
'rate
'Payment
'dummy
'Tpay
'Tint
E
#19
:n
MCA_In
:v
'Price_In
'Downpay_In
'dpp_In
'Loan_In
'Term_In
'rate_In
'Payment_In
'dummy_In
E
#20
:n
dummy_In
:c
ALL ENTRIES=0, MUST BE AS LONG AS ANY OTHER LIST
:v
0
0
0
0
0
0
0
0
0
0
E
=f
#1
:n
assign
:c
Assignment function for Multicase Analysis
:t
Rule
:a
Price,Downpay,dpp,Loan,Term,rate,Payment
#2
:n
copy
:c
Copies MCA_In into MCA_Table with  / E E
:t
Rule
:v
st
#3
:n
Mcopy
:c
Copy matrix (i.e. subordinate lists)
:t
Procedure
:i
M1,M2
#1
:n
assign
:z
" This function reads, from each list in MCA_Table, the current element
" (if it exists) and passes it back to the Rule Sheet.  This is simply done
" here without having to refer to a procedure function since block solving
" is being used and elt() will pick out the proper number for the case.

Price = elt('Price,elt(),0/0)
Downpay = elt('Downpay,elt(),0/0)
dpp = elt('dpp,elt(),0/0)
Loan = elt('Loan,elt(),0/0)
Term = elt('Term,elt(),0/0)
rate = elt('rate,elt(),0/0)
Payment = elt('Payment,elt(),0/0)
/E
E
#2
:n
copy
:z
" This function is not used during block solving.  It is called via the
" keystroke / E E copy().  It then calls Mcopy, which does the actual
" copying.  Finally, it returns a message heralding completion through the
" result variable  st .

call Mcopy('MCA_In,'MCA_Table)
call blank('Tpay)
call blank('Tint)
st='Copying_Done
/E
E
#3
:n
Mcopy
:z
" This procedure copies subordinate lists of the masterlist M1 into
" subordinate lists of the masterlist M2.

for i=1 to length(M1)
   call listcopy(M1[i],M2[i])   " error indicates no listname in ith
                                " element of either M1 or M2
next i
/E
E
=r
#1
:r
"          ***  L o a n   M o d e l ,  Multicase Analysis  ***
:s
C
#3
:r
call assign(Price,Downpay,dpp,Loan,Term,rate,Payment)
#5
:r
Downpay = Price * dpp
#6
:r
Loan = Price - Downpay
#7
:r
Payment = Loan * rate/(1-(1+rate)^-Term)
#8
:r
Tpay = Payment * Term
#9
:r
Tint = Tpay - Loan
#11
:r
" N o t e s :
:s
C
#13
:r
" 'Multicase Analysis' is the TK technique of using Interactive Tables for
:s
C
#14
:r
" setting up and analyzing simultaneously problems with different input
:s
C
#15
:r
" and output variables.  This model shows the MCA technique applied to a
:s
C
#16
:r
" simple loan analysis model. 
:s
C
#18
:r
" The design or modification of a model for Multicase Analysis typically
:s
C
#19
:r
" includes the following stages:
:s
C
#20
:r
"
:s
C
#21
:r
" 1. Selection of variables for Multicase Analysis (we will refer to them
:s
C
#22
:r
"    as MCA variables).
:s
C
#23
:r
" 2. Declaring MCA variables as lists by typing  L  in all their Status
:s
C
#24
:r
"    fields in the Variable Sheet.
:s
C
#25
:r
" 3. Adding a "dummy" variable to the Variable Sheet, and associating it with
:s
C
#26
:r
"    a so-called input list by typing  L I  in its Status field.  This step
:s
C
#27
:r
"    is necessary only if you later want to use list solving (F10) instead of
:s
C
#28
:r
"    block solving (/LB) for solving all the cases at once.
:s
C
#29
:r
" 4. Setting up a "horizontal" Interactive Table consisting of MCA lists.
:s
C
#30
:r
" 5. Setting up a rule function 'assign' with all MCA variables as Input
:s
C
#31
:r
"    Variables, and with a rule  xyz=elt('xyz,elt(),0/0)  for each of them
:s
C
#32
:r
"    (see the 'assign' function in this model).
:s
C
#33
:r
" 6. Setting up in the Rule Sheet a rule   call assign(...)   with all the
:s
C
#34
:r
"    MCA variables as arguments.
:s
C
#35
:r
" 7. Modifying the Global Sheet settings if necessary -- see points (c) and
:s
C
#36
:r
"    (e) below.
:s
C
#37
:r
" 8. Bringing up the Interactive Table and building up the cases represented 
:s
C
#38
:r
"    by the columns (i.e. assigning input values to different variables in
:s
C
#39
:r
"    different cases). 
:s
C
#40
:r
" 9. List solving (F10) the model for all the cases or block solving (/LB)
:s
C
#41
:r
"    the selected range of cases.
:s
C
#42
:r
"10. Repeating steps 8. and 9. as needed.
:s
C
#44
:r
" Additional usage notes:
:s
C
#45
:r
"
:s
C
#46
:r
" (a) There may be additional list or non-list input variables in the model
:s
C
#47
:r
"     that are not MCA variables (i.e. they do not appear in the 'assign'
:s
C
#48
:r
"     function).  They will serve well as inputs, and can even be blanked
:s
C
#49
:r
"     and have their values evaluated, but their values would not show up
:s
C
#50
:r
"     in the list or in the Interactive Table.
:s
C
#51
:r
" (b) An MCA variable cannot be declared a guess variable (which would imply
:s
C
#52
:r
"     temporary input status, thus causing problems indicated in the previous
:s
C
#53
:r
"     paragraph).  The Iterative Solver may be invoked, when necessary and
:s
C
#54
:r
"     depending on a particular selection of input variables, by using the
:s
C
#55
:r
"     Automatic Iteration feature and default First Guess values (see the
:s
C
#56
:r
"     variable   rate   in this model).
:s
C
#57
:r
" (c) The variables that have their values retrieved from the lists by the
:s
C
#58
:r
"     'assign' function have an "evaluated" rather than true "input" status.
:s
C
#59
:r
"     If the model is partially or fully resolved for a particular instance,
:s
C
#60
:r
"     all the values are returned to the lists, and keep showing in the 
:s
C
#61
:r
"     Interactive Table.  If, however, the solution of a particular instance
:s
C
#62
:r
"     is terminated by an error condition, the values of evaluated variables 
:s
C
#63
:r
"     returning to lists turn blank, and the whole column in the Interactive
:s
C
#64
:r
"     Table is wiped out.  This may be prevented by setting the 'Stop on List
:s
C
#65
:r
"     Error' field on the Global Sheet to  Yes .
:s
C
#66
:r
" (d) When the solution is halted as described in the previous paragraph, 
:s
C
#67
:r
"     the dummy list input variable loses its input status (unless it has
:s
C
#68
:r
"     got a non-blank value in the particular element).  This is easy to
:s
C
#69
:r
"     prevent assigning 0 to all elements of the dummy list, or by making
:s
C
#70
:r
"     the variable   dummy   input again.
:s
C
#71
:r
" (e) The 'Display Intermediate Values' field on the Global Sheet may be
:s
C
#72
:r
"     set to 'No' to speed up the redisplay of the values in the Interactive
:s
C
#73
:r
"     Table.
:s
C
=p
=t
#1
:n
MCA_In
:s
Screen
:v
Horizontal
:f
1
:r
""
:c
""
:t
"Change MCA_In values, type  /EE copy() , press F10"
:u
#1
:l
Price_In
:n
Currency
:w
10
:h
""
#2
:l
Downpay_In
:n
Currency
:w
10
:h
""
#3
:l
dpp_In
:n
Currency
:w
10
:h
""
#4
:l
Loan_In
:n
Currency
:w
10
:h
""
#5
:l
Term_In
:n
Currency
:w
10
:h
""
#6
:l
rate_In
:n
Currency
:w
10
:h
""
#7
:l
Payment_In
:n
Currency
:w
10
:h
""
E
#2
:n
MCA_Table
:s
Screen
:v
Horizontal
:f
1
:r
""
:c
""
:t
"Loan Model - Multi-Case Analysis"
:u
#1
:l
Price
:n
Currency
:w
10
:h
""
#2
:l
Downpay
:n
Currency
:w
10
:h
""
#3
:l
dpp
:n
Currency
:w
10
:h
""
#4
:l
Loan
:n
Currency
:w
10
:h
""
#5
:l
Term
:n
Currency
:w
10
:h
""
#6
:l
rate
:n
Currency
:w
10
:h
""
#7
:l
Payment
:n
Currency
:w
10
:h
""
#8
:l
Tpay
:n
Currency
:w
10
:h
""
#9
:l
Tint
:n
Currency
:w
10
:h
""
E
#3
:s
Screen
:v
Vertical
:f
1
:r
""
:c
""
:t
""
:u
E
=n
#1
:n
Currency
:d
15
:f
2
:^
Decimal
:e
"."
:m
""
:c
Financial Notation
:p
Zero
:j
Right
:s
- Only
:q
0
:x
0
:l
""
:t
""
:v
"0.00"
=g
#1
:c
.000001
:i
10
:v
Yes
:l
60
:f
66
:m
0
:w
80
:b
Yes
:a
Yes
:r
Yes
:h
Yes
:t
1
:n
Yes
:d
LPT1
%Tt,f,0,0,0,1,0>t,0,0,0,8,0>f,0,1,0,2,0
%Ot,f,1,0,0,1,0>f,0,0,7,1,0>f,8,1,1,1,0
